package com.pro.service.imple;/**
 * @Author 许振杰
 * @Date 2022/2/8 0008 9:45
 * @Version 1.0
 */

import com.pro.mapper.JsApplyRecordMapper;
import com.pro.pojo.JsApplyRecord;
import com.pro.pojo.JsAuditLog;
import com.pro.pojo.JsCourseRecord;
import com.pro.pojo.JsonData;
import com.pro.service.JsApplyRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Title: 创作者管理service实现类
* @author 许振杰
* @date 2022/2/8 0008 9:47
* @version V1.0
*/
@Service
public class JsApplyRecordServiceImple implements JsApplyRecordService {

    @Autowired
    private JsApplyRecordMapper applyRecordMapper;

    /**
    * @Title: 创作者申请列表
    * @author 许振杰
    * @date 2022/2/8 0008 9:46
    * @version V1.0
    */
    @Override
    public List<JsApplyRecordMapper> getApplyRecord(JsApplyRecord applyRecord) {
        return applyRecordMapper.getApplyRecord(applyRecord);
    }

    /**
    * @Title: 根据不同的状态查询不同的 用户
    * @author 许振杰
    * @date 2022/2/8 0008 10:48
    * @version V1.0
    */
    @Override
    public List<JsApplyRecord> getApplyRecordByResult(Integer result) {
        return applyRecordMapper.getApplyRecordByResult(result);
    }

    /**
    * @Title: 修改审核状态
    * @author 许振杰
    * @date 2022/2/8 0008 11:33
    * @version V1.0
    */
    @Override
    public boolean editApplyRecordById(JsApplyRecord applyRecord) {
        return applyRecordMapper.editApplyRecordById(applyRecord);
    }

    /**
    * @Title: 添加审核日志
    * @author 许振杰
    * @date 2022/2/8 0008 13:39
    * @version V1.0
    */
    @Override
    public boolean addAuditLog(JsAuditLog auditLog) {
        return applyRecordMapper.addAuditLog(auditLog);
    }

    /**
    * @Title: 添加审核记录
    * @author 许振杰
    * @date 2022/2/8 0008 14:27
    * @version V1.0
    */
    @Override
    public boolean addCourseRecord(JsCourseRecord courseRecord) {
        return applyRecordMapper.addCourseRecord(courseRecord);
    }

    /**
    * @Title: 已处理申请列表
    * @author 许振杰
    * @date 2022/2/8 0008 15:26
    * @version V1.0
    */
    @Override
    public List<JsApplyRecord> getApplicationProcessedList(JsApplyRecord applyRecord) {
        return applyRecordMapper.getApplicationProcessedList(applyRecord);
    }

    /**
    * @Title: 创作者审核日志
    * @author 许振杰
    * @date 2022/2/8 0008 16:36
    * @version V1.0
    */
    @Override
    public List<JsAuditLog> getAuditLog(JsAuditLog auditLog) {
        return applyRecordMapper.getAuditLog(auditLog);
    }

    /**
    * @Title: 根据不同的状态展示不同的审核日志状态
    * @author 许振杰
    * @date 2022/2/8 0008 16:58
    * @version V1.0
    */
    @Override
    public List<JsAuditLog> getAuditLogByType(JsAuditLog auditLog) {
        return applyRecordMapper.getAuditLogByType(auditLog);
    }

    /**
     * @Title: 删除审核日志
     * @author 许振杰
     * @date 2022/2/8 0008 18:54
     * @version V1.0
     */
    @Override
    public boolean delAuditLog(Integer auditLogId) {
        return applyRecordMapper.delAuditLog(auditLogId);
    }
    /**
     * @Author 祖铭泽
     * @Date 2022/2/17/0014
     * @description 查询正在申请创作者的数量
     */
    @Override
    public JsonData getApplyForApplyRecordCount(Integer result) {
        Integer applyForApplyRecordCount = applyRecordMapper.getApplyForApplyRecordCount(result);
        return applyForApplyRecordCount != null ? JsonData.buildSuccess(applyForApplyRecordCount) : JsonData.buildError("获取失败");
    }


}
